<?php
namespace app\index\model;
use frame\app\Model;
use frame\lib\Db;

class Comment extends Model{
    public static function list($query = '')
    {
        $uid = $_SESSION['user']['id'];
        if($query){
            $list = Db::name('comment')->where(['user_id' => $uid])->like('comment' , "%$query%")->select();
        }else{
            $list = Db::name('comment')->where(['user_id' => $uid])->select();
        }
        return $list;
    }
   
}